Conversation
|
Now that we don't support Chez 9.6, we should be able to shrink src/swish/compat.ss and possibly move the definitions elsewhere. |
|
In src/swish/software-info.ss, we no longer need to check |
burgerrg
left a comment
There was a problem hiding this comment.
I've reviewed the documentation and like the changes!
|
Please update .github/workflows/test.yml to use actions/checkout@v6. |
4c3d868 to
07dbc08
Compare
|
src/swish/swish-build.ms has comments about 9.5.3 error messages. These can be removed now. |
|
On line 1386 of erlang.tex, we find: It should say: |
| (string-escape ip op)) | ||
| (unexpected-input 'string (read-char ip) ip)) | ||
| (read-string ip op mark json5?)] | ||
| [(char<=? c #\x1F) |
There was a problem hiding this comment.
I think JSON5 allows control characters to be unescaped.
|
A micro-benchmark on my laptop indicates that performing a generic hashtable-ref costs ~20 ns, whereas a symbol-hashtable-ref costs ~10 ns. Switching (swish json) to use symbol hash tables roughly doubles the speed of lookups. We go from 30 ns/call to 15 ns/call. P.S. The allocation appears to occur in other Swish processes, not the benchmark. |
|
I think all the uses of |
adbde9b to
b3694b0
Compare
burgerrg
left a comment
There was a problem hiding this comment.
Thanks for this detailed update!
This introduces new json:read-options and json:write-options. custom-inflate is now the inflate-object field of json:read-options
- remove (swish compat); move no-inline into erlang.ss - redefine make-codec-buffer, print-extended-identifiers, print-subnormal-precision, transcoded-port-buffer-size - update all github actions
|
Thanks for the review Bob! |
Fixes
fixed an issue where reading a JSON string immediately after a failure to read a string resulted in incorrect output.
fixed an issue where reading a JSON float with a large exponent consumed CPU.
Proposed changes
require Chez Scheme 10.3.0; drop 9.6.4
breaking: change representation of JSON null from the character
#\nulto the symbolnullbreaking: change JSON read and write functions to use options
This introduces new
json:read-optionsandjson:write-options.custom-inflateis now theinflate-objectfield ofjson:read-options.custom-writeis now thecustom-writefield ofjson:write-options.breaking: move stack->json and json-stack->string to json.ss
Code that used
(import (swish log-db))may now need(import (swish json))to access these procedures.A new
json5?option allows disabling JSON5 support. By default JSON5 is enabled.A new
inflate-symboloption allows raw symbols in JSON-like input to be internalized using a custom function.A new
extended-identifiers?option allows raw symbols in JSON-like input to include characters not allowed by the JSON5 identifier syntax.split JSON documentation into a separate chapter
export
json:key=?